﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Negocio;
using Modelo;

namespace Interfaces
{
    /// <summary>
    /// Interaction logic for IURecetasUsadas.xaml
    /// </summary>
    public partial class IURecetasUsadas : Window
    {
        Usada r = new Usada();
        public IURecetasUsadas()
        {
            InitializeComponent();
            dataGrid1.ItemsSource = ControladorReceta.RecetasMasUsadas();
        }
        private void dataGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                r = (Usada)dataGrid1.SelectedItem;
                IUReceta receta = new IUReceta(false, r);
                receta.Show();
            }
            catch (Exception ex)
            {
                errorLb.Content = ex.Message;
            }
        }
    }
}
